package bat.iog.tomcat.core;


/**
 * @author :dongshuo
 * @date : 2018/12/16 13:08
 * @desc :
 */
public abstract class MyServlet {
    //子类重写具体的业务代码
    public abstract void doGet(MyRequest myRequest, MyResponse myResponse);
    public abstract void doPost(MyRequest myRequest,MyResponse myResponse);

    public void service(MyRequest myRequest,MyResponse myResponse) {
        if ("POST".equalsIgnoreCase(myRequest.getMethod())) {
            doPost(myRequest,myResponse);
        }else if ("GET".equalsIgnoreCase(myRequest.getMethod())) {
            doGet(myRequest,myResponse);
        }
    }
}


